import re
# ^以什么开头([]外面写^)  取反([]里面写^)
# m1 = re.match("^h","hello")
# print(m1.group())
# m2 = re.match("^[a-z]","hello123")  # 以小写字母开头
# print(m2.group())
# m3 = re.match("[^a-z]","Hhello")  # 不是小写字母
# print(m3.group())

# $以什么结尾
# m1 = re.match(".*o$","hello")
# print(m1.group())
m1 = re.match(".*o$","hellow")  # o-w
print(m1.group()) # 报错